//Domain
//http://order.x-juse.com/
//Namespace
//Juse.Interface
//ClassName
//JSShop.BLL.Interface.ShoppingCartInterface
//请勿修改上述接口信息
namespace Juse.Interface
{
    public class ShoppingCartInterface : wnxd.Web.InterfaceBase
    {
        public ShoppingCartInterface()
        {
            this.Domain = "http://order.x-juse.com/";
            this.Namespace = "JSShop.BLL.Interface";
            this.ClassName = "ShoppingCartInterface";
        }
        /// <summary>
        /// 根据用户id获取购物车信息
        /// </summary>
        public JSShop.Model.ShoppingCartInfo GetShoppingCartById(System.Int32 userid)
        {
            wnxd.javascript.json r = this.Run("2D63DD65B49D779412691FD201C80B28", userid);
            return (JSShop.Model.ShoppingCartInfo)r.TryConvert(typeof(JSShop.Model.ShoppingCartInfo));
        }
        /// <summary>
        /// 从xml中读取购物车信息
        /// </summary>
        public JSShop.Model.ShoppingCartInfo GetShoppingCartByXml(System.String xml)
        {
            wnxd.javascript.json r = this.Run("6B70EAA3A03F47632D376847934B4E67", xml);
            return (JSShop.Model.ShoppingCartInfo)r.TryConvert(typeof(JSShop.Model.ShoppingCartInfo));
        }
        /// <summary>
        /// 根据用户id清除购物车信息
        /// </summary>
        public System.Boolean ClearShoppingCart(System.Int32 userid)
        {
            wnxd.javascript.json r = this.Run("E912D29E09BB175517483E1696D8BED6", userid);
            return (System.Boolean)r.TryConvert(typeof(System.Boolean));
        }
        /// <summary>
        /// 添加商品到购物车
        /// </summary>
        public System.Boolean AddLineItem(System.Int32 userId, System.String skuId, System.Int32 quantity)
        {
            wnxd.javascript.json r = this.Run("55FFA9B400273B20F8F4384B025834CD", userId, skuId, quantity);
            return (System.Boolean)r.TryConvert(typeof(System.Boolean));
        }
        /// <summary>
        /// 添加赠品到购物车
        /// </summary>
        public System.Boolean AddGiftItem(System.Int32 userId, System.Int32 giftId, System.Int32 quantity, JSShop.Enum.PromoteType promotype)
        {
            wnxd.javascript.json r = this.Run("E4A130F6FDF5F63A9EB87E789D4C26B3", userId, giftId, quantity, promotype);
            return (System.Boolean)r.TryConvert(typeof(System.Boolean));
        }
        /// <summary>
        /// 把指定购物车信息导入数据库
        /// </summary>
        public void ConvertShoppingCartToDataBase(System.Int32 userId, JSShop.Model.ShoppingCartInfo shoppingCart)
        {
            wnxd.javascript.json r = this.Run("54874C9885615EDEC28CD067A0E6EF25", userId, shoppingCart);
        }
        /// <summary>
        /// 获取团购商品购物车
        /// </summary>
        public JSShop.Model.ShoppingCartInfo GetGroupBuyShoppingCart(System.Int32 userId, System.String productSkuId, System.Int32 buyAmount)
        {
            wnxd.javascript.json r = this.Run("DD2A1CAE0614C84A213B43E6496FAB9C", userId, productSkuId, buyAmount);
            return (JSShop.Model.ShoppingCartInfo)r.TryConvert(typeof(JSShop.Model.ShoppingCartInfo));
        }
        /// <summary>
        /// 获取指定商品临时购物车
        /// </summary>
        public JSShop.Model.ShoppingCartInfo GetShoppingCart(System.Int32 userId, System.String productSkuId, System.Int32 buyAmount, System.Boolean spread = false)
        {
            wnxd.javascript.json r = this.Run("3C52DC93C261A95D141E5B3FACF8419D", userId, productSkuId, buyAmount, spread);
            return (JSShop.Model.ShoppingCartInfo)r.TryConvert(typeof(JSShop.Model.ShoppingCartInfo));
        }
    }
}